package iO;

import java.io.File;
import java.io.Serializable;

/**
 * @Author: Miyako
 * @Date: 2024-07-16-16:27
 * @Description:
 */
public class Message implements Serializable {//该接口里没有方法仅仅起到标识作用
    private static final long serialVersionUID = -3339202889242068185L;//自定义一个序列化id，好处在于更改方法和属性后之前序列化的对象依旧可以反序列化
    // 若没有自定义会根据方法与属性进行隐式的生成一个，但是自动创建的序列化id会随着类结构的改变而不可用
    private Integer id;
    private String title;

    private String content;

    Message() {
    }
    Message(Integer id, String title, String content) {
        this.id = id;
        this.title = title;
        this.content = content;
    }


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Override
    public String toString() {
        return "Message{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                '}';
    }
}
